<?php

/**
 * welcome actions.
 *
 * @package    SchelkinoBiz
 * @subpackage welcome
 * @author     Delight
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class welcomeActions extends sfActions
{
    /**
     * Executes index action
     *
     * @param sfRequest $request A request object
     */
    public function executeIndex(sfWebRequest $request)
    {
        $cri = new Criteria();

        $cri->add( TextareaPeer::TEXTAREA, $request->getParameter( "textarea", "schelkino" ) );

        $this->textarea = TextareaPeer::doSelectWithI18n( $cri );
    }

    public function executeNewsblock(sfWebRequest $request)
    {
        $cri = new Criteria();

        if ( $request->hasParameter( "news_id" ) )
        {
            $cri->add( NewsblockPeer::ID, $request->getParameter( "news_id", 0 ) );
        }

        $cri->addDescendingOrderByColumn( NewsblockPeer::NEWS_DATE );

        $this->news = NewsblockPeer::doSelectWithI18n( $cri );
    }

}
